#pragma once
#include <directxmath.h>
#include <vector>

using namespace DirectX;

typedef unsigned int        UINT;
typedef unsigned short      WORD;

struct Vertex
{
	
	XMFLOAT3 pos;
	XMFLOAT3 normal;
	XMFLOAT2 tex;
};

/*Vertex(float x, float y, float z, float nx, float ny, float nz, float u, float v) :
	pos(XMFLOAT3(x, y, z)),
	normal(XMFLOAT3(nx, ny, nz)),
	tex(XMFLOAT2(u, v)){};

void setPos(float x, float y, float z){	pos = XMFLOAT3(x, y, z); }
void setNormal(float x, float y, float z) { normal = XMFLOAT3(x, y, z); }
void setTex(float u, float v) { tex = XMFLOAT2(u, v); }*/


class Mesh
{
public:
	Mesh();
	~Mesh();
	void AddVertex(Vertex v);
	void AddVertex(float x, float y, float z, float nx, float ny, float nz, float u, float v);
	void AddTriangle(short v1, short v2, short v3);
	int GetVerticesCount() { return vertices.size(); };
	int GetIndicesCount() { return indices.size(); };
	Vertex *GetVertices();
	short *GetIndices();
	UINT GetIndicesByteWidth(){ return indices.size()*sizeof(short); };
	UINT GetVerticesByteWidth(){ return vertices.size()*sizeof(Vertex); };

private:
	std::vector<Vertex> vertices;
	std::vector<short> indices;


};

